UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K5LiEASD26eAhFfaLxPkAegkpXhpqM1fCCOWXPBt0XY='
WHERE
key_id = '75c251325d6c2e1b563844f1182531cc9133d7f9880dbac89bbd60bc4985b471'
AND (
token = 'K5LiEASD26eAhFfaLxPkAegkpXhpqM1fCCOWXPBt0XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)