UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zz83rgcVS/6rav4q/DKJI/7WInRM4S6K7SpjXNHSuTw='
WHERE
key_id = 'da0797caaa5054fd49a3c8337dbc3c79223e24a85d1e3442b255c83cdf36e5e4'
AND (
token = 'Zz83rgcVS/6rav4q/DKJI/7WInRM4S6K7SpjXNHSuTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)