UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BoipWdHw3yiZKTO3LPHXaWXHi+wYd8L2uqgdlsoh9uc='
WHERE
key_id = '64b4ebf849da8210ca682d32f5cbb88c191ab59bd21c76e7ea7e4ddbfec50c66'
AND (
token = 'BoipWdHw3yiZKTO3LPHXaWXHi+wYd8L2uqgdlsoh9uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)