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