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