UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lfmQEHiQD2R+JydTBhI5qy16OV7yWeFHtpLlQn/uOJA='
WHERE
key_id = '5b947ca304a8891ca97088b22b6d115687ffdd1dc887b78b9be3f019126c4de3'
AND (
token = 'lfmQEHiQD2R+JydTBhI5qy16OV7yWeFHtpLlQn/uOJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)