UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8kw88dRaHpqR28leqgQGPEIVVIAQI6Vs4YYHTt3gdQg='
WHERE
key_id = 'bd6f8e5b5764f2950b12faaf91b3f9f2a594e448db018b9ab0fb32e547c1521c'
AND (
token = '8kw88dRaHpqR28leqgQGPEIVVIAQI6Vs4YYHTt3gdQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)