UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dEFlhcGxrizDTcxlCPttWMzDU/0bVz0CETDYZWsxkhg=' 
WHERE 
  key_id = 'c0cd6517cc86e931c9153c42ba5bef0a6dd3345da6798e47d29ff232fd70f771' 
  AND (
    token = 'dEFlhcGxrizDTcxlCPttWMzDU/0bVz0CETDYZWsxkhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024