UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ec8gBNLeJcT8UUquqmuBfoMMUnKl3JOV15S5GvMfBr0='
WHERE
key_id = '976a6a1731a0fdef82f817979418172f91d51c408acaad2aac55f3b1f0022206'
AND (
token = 'ec8gBNLeJcT8UUquqmuBfoMMUnKl3JOV15S5GvMfBr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)