UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K00bD3y3wD6u91KQzrUVsAvfyagjAObzOU+hZCRwKMo='
WHERE
key_id = '2be5ba4c9fd16d7c4ffc5d390902c4719ec491344b5ed0f50efb6868a5f7d43a'
AND (
token = 'K00bD3y3wD6u91KQzrUVsAvfyagjAObzOU+hZCRwKMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)