UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DOzbrgHsSlXoLOvUpHR+upy+Ozqj25f1NTD1RwjobZs='
WHERE
key_id = 'e74cdbf2c482be11c8f141abaaddec1d17c2476b73cf568613595944943b70e8'
AND (
token = 'DOzbrgHsSlXoLOvUpHR+upy+Ozqj25f1NTD1RwjobZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)