UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TctRwQEtEQV8TeTbT1dz6Z1x+JiDuDjNk49k3k0qzOM='
WHERE
key_id = '2ea4e3bb8f1bf6fb9fb06be349b079718fccbee42eb396641032c20546c070c8'
AND (
token = 'TctRwQEtEQV8TeTbT1dz6Z1x+JiDuDjNk49k3k0qzOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)