UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HY7XDfqJibswyULjI6Ow9Z1PMQYidWpIQIcIk6LPHAM=' 
WHERE 
  key_id = '29af7002d03a20ae3c09a48fdb6a30d76ae4556ae3add84bc6b6417d2476650c' 
  AND (
    token = 'HY7XDfqJibswyULjI6Ow9Z1PMQYidWpIQIcIk6LPHAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025