UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/PJZ98pWf1K4i/zIZVEZJhAj5Fypm7gLk0Mk/I5zGjM='
WHERE
key_id = '52aa9c700f4b0306d6d8b658b934bf149af6cc3a84fc094205b80fc88e55019c'
AND (
token = '/PJZ98pWf1K4i/zIZVEZJhAj5Fypm7gLk0Mk/I5zGjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)