UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rH1OOMs6wcSOSQ6hgfySCHJE3gsnREWCS0zrYdgxfJE='
WHERE
key_id = 'da0e17a63dfdadaaf2420b9d2a526a97c81902946f0ed27d089a7cb566afe21e'
AND (
token = 'rH1OOMs6wcSOSQ6hgfySCHJE3gsnREWCS0zrYdgxfJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)