UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MiuWNUko4wJD498CW5zJEKkcqOOguEHNUG2ekAI8CtE=' 
WHERE 
  key_id = 'd1545e875ddf1830f0ea9a200033a3af0f0d1ef7913bdf4ae982ad1ee1013c1c' 
  AND (
    token = 'MiuWNUko4wJD498CW5zJEKkcqOOguEHNUG2ekAI8CtE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027