UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ql88Z6uV4eJJO5jgAhX4lGj4FJTdi4pvQHPdD7YMnV0=' 
WHERE 
  key_id = '10862f2321bf1b976bc43be18990c52fbfeef043b73f945874c26d49a4c9e86e' 
  AND (
    token = 'ql88Z6uV4eJJO5jgAhX4lGj4FJTdi4pvQHPdD7YMnV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036