UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DIS8gXz0rycee3sVi15LTWsGXH+HQHa+MlYkRXHYQiY='
WHERE
key_id = '78f4fe8ccf3c90efdf71594bb16a7625f8a7c65a6a3ca69bbf38d4d0de05bf2b'
AND (
token = 'DIS8gXz0rycee3sVi15LTWsGXH+HQHa+MlYkRXHYQiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)