UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v5XGBWc7UdWLn/xSM2UHdOH8MmxTb6bDRn/wwHXe2ms='
WHERE
key_id = 'a9df1a66d65a66dab48b00ed0f68665f254ad3960b5dcd2727811a38c71ffc71'
AND (
token = 'v5XGBWc7UdWLn/xSM2UHdOH8MmxTb6bDRn/wwHXe2ms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)