UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InlZRtjF+1hthCMdTLvVk+GJS2sSkg+V6AMGQgG8JQ0='
WHERE
key_id = '94002214d7417b75f850800683d271e819d2c0928e6b505d86460214d7064d27'
AND (
token = 'InlZRtjF+1hthCMdTLvVk+GJS2sSkg+V6AMGQgG8JQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)