UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rdTVYge3EAy58g6tL1P7iyOcNg1N2BPI3K5gKa9KxmQ='
WHERE
key_id = '5e41f34548b5e23ef18de25258639144f2bef855a3f4505a62b7059238f05bd6'
AND (
token = 'rdTVYge3EAy58g6tL1P7iyOcNg1N2BPI3K5gKa9KxmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)