UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'stzUOuwVbNKblnhGXWTIDET8iuHMWu2S23uL59lQMKE='
WHERE
key_id = 'daab8b7489649feffe28553dc62dca8afff86d6ee65d4213407fbf765a019dec'
AND (
token = 'stzUOuwVbNKblnhGXWTIDET8iuHMWu2S23uL59lQMKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)