UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fOT7lX2dg1NX67vFmKgXsrGfgLv6tgTydLGxHjtqI2A='
WHERE
key_id = '362e67230d0da31237865986aebb93fbe3fdac2bdf6f2fbd4cb135822078fb57'
AND (
token = 'fOT7lX2dg1NX67vFmKgXsrGfgLv6tgTydLGxHjtqI2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)