UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjM389Z9DErJY/WJ5PYhEYHPp/3FtWAmGtCl0n8ZJEg='
WHERE
key_id = '30123ebb2e9e8e99a031c4b56ee832e4a7e99c099322ab70b1acc2d8b2360f58'
AND (
token = 'WjM389Z9DErJY/WJ5PYhEYHPp/3FtWAmGtCl0n8ZJEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)