UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1koa3jopJ5VyzEX+yfkKDwCiYSl6S+pbWzoG867Opr0=' 
WHERE 
  key_id = '4992db27a4c26c649afe95af47432d590d018786d0b872ffbcb29b62090b1939' 
  AND (
    token = '1koa3jopJ5VyzEX+yfkKDwCiYSl6S+pbWzoG867Opr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025