UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtCD+CXt2c0yvy7nHpicOKumRfcZWkC55+IAsM/IqhI='
WHERE
key_id = '4ba100cf2c2e8295aa002404234c847c3893af18f86a9fa0fe2324a86304b862'
AND (
token = 'YtCD+CXt2c0yvy7nHpicOKumRfcZWkC55+IAsM/IqhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)