UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CUHnZgNGjnTv/96IDsK9PunbvGOetw6yQdJ6a6IRqO0='
WHERE
key_id = '71583b80cbfcb39836bcda8fd0dccb8e2f274ddc4da8e1e05da81ecf20dc8d90'
AND (
token = 'CUHnZgNGjnTv/96IDsK9PunbvGOetw6yQdJ6a6IRqO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)