UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cQWFvXUVBrVuB4lzvJBnbL77jnG2N4MWpUj+jaDXgJs=' 
WHERE 
  key_id = '088fc1dcc6772c39c699cd889bcdbe320843ec9e824250c36c28522007c608a9' 
  AND (
    token = 'cQWFvXUVBrVuB4lzvJBnbL77jnG2N4MWpUj+jaDXgJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028