UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CG/TjF4xajmjZWotQwm1cSw6LrC+qsrWZn96Tk8R7Ko=' 
WHERE 
  key_id = '55707bd7d53d3f3567157fbdbfd41c29662dfa365bb4cb393e44fb968cd5c7e2' 
  AND (
    token = 'CG/TjF4xajmjZWotQwm1cSw6LrC+qsrWZn96Tk8R7Ko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034