UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5OoakQkpqk/6hRizjtaE9YGg2mQR6kx4yOzMMcEEzZ8='
WHERE
key_id = '3182761427176f567fe392461c3e9e417404c8067b0aa9412611d89b08bf352d'
AND (
token = '5OoakQkpqk/6hRizjtaE9YGg2mQR6kx4yOzMMcEEzZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)