UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/YcHWjcAbt7SZc/Iyz/CxIPWOeFX9a0DiqeJ9pOb+iY='
WHERE
key_id = '97dfacfd1d51d6881d9fb6ae621e3e7660210d7d1f5ece67a5158448acf5ae9a'
AND (
token = '/YcHWjcAbt7SZc/Iyz/CxIPWOeFX9a0DiqeJ9pOb+iY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)