UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D18xTm+swEtiND9H6CMLyTaxfmjtBpy9bDUecGuSmSQ='
WHERE
key_id = '3c921ffc1ece262e4d7bc1f1258ec864a570a86402f871dcdab26e944a513cae'
AND (
token = 'D18xTm+swEtiND9H6CMLyTaxfmjtBpy9bDUecGuSmSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)