UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MevAIqHpPEXE3GfvgzqOvKZ76AxeHX8hB6JvkdV3pzY='
WHERE
key_id = '0cddc427773c8d345d0a291f6e75f95003bc47f0694a7b5ffdcbea6147897789'
AND (
token = 'MevAIqHpPEXE3GfvgzqOvKZ76AxeHX8hB6JvkdV3pzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)