UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'auvyWw183+FxwHiPPnFK5kY+JheGayXxZUzU733hHfg='
WHERE
key_id = 'ac2a55016c55a77333535d3f88889e4ee2705a2ba784e280dd6308b1f69530f7'
AND (
token = 'auvyWw183+FxwHiPPnFK5kY+JheGayXxZUzU733hHfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)